package com.design.flyweight.football;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiemiao
 * @description
 * @date 2023/08/16
 */
public class NationTitleFactory {

    private static Map<String, NationTitle> titleMap = new HashMap<>();

    public static NationTitle getTitle(String country) {
        if (!titleMap.containsKey(country)) {
            NationTitle nationTitle = new NationTitle(country);
            titleMap.put(country, nationTitle);
        }
        return titleMap.get(country);
    }
}
